import React, { lazy } from 'react'
import { WapHomeO, AppsO, CartO, UserO } from '@react-vant/icons';
const Home = lazy(() => import('../views/home'))
const Car = lazy(() => import('../views/car'))
const Classify = lazy(() => import('../views/classify'))
const My = lazy(() => import('../views/my'))


const Detail = lazy(() => import('../views/detail'))
const Login = lazy(() => import('../views/login'))
const MainLayout = lazy(() => import('../views/mainLayout'))
const Order = lazy(() => import('../views/order'))
const PayResult = lazy(() => import('../views/payResult'))


export const LayoutChildRoutes = [{
  path: '/',
  element: <Home></Home>,
  meta: {
    title: '首页',
    icon: <WapHomeO  />
  }
},{
  path: '/classify',
  element: <Classify></Classify>,
  meta: {
    title: '分类',
    icon: <AppsO  />
  }
},{
  path: '/car',
  element: <Car></Car>,
  meta: {
    title: '购物车',
    icon: <CartO  />
  }
},{
  path: '/my',
  element: <My></My>,
  meta: {
    title: '我的',
    icon: <UserO  />
  }
}]

export const RootRoutes = [{
  path: '/',
  element: <MainLayout></MainLayout>,
  children: LayoutChildRoutes
},{
  path: '/detail/:id',
  element: <Detail></Detail>
},{
  path: '/login',
  element: <Login></Login>
},{
  path: '/order',
  element: <Order></Order>
},{
  path: '/pay/result',
  element: <PayResult></PayResult>
}]